<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<head>
	<style type="text/css">
.detect{
	width: 100%;
	border:1px solid #B8BAB9;
	}
.detect td{
   	padding:  0.5em 0px 0.5em 0px;
	text-align: center;
	border:1px solid #B8BAB9;
}
.tdsd td{
	padding:  0.5em 0px 0.5em 0px;
}
#mainForm th {
	background:#E0E0E0;
}
.detect th{
 	padding:  0.5em 0px 0.5em 0px;
	text-align: center;
	border:1px solid #B8BAB9;
	color: #333333;
}
.yform{
margin: 0;
}

</style>
<script type="text/javascript"
	src="<c:url value='/ext/ui/jquery-ui-1.8.12.custom.min.js'/>"></script>
<script src="${ctx}/scripts/plugin/jquery.multiselect.min.js" type="text/javascript"></script>
<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css"
	rel="stylesheet" />
<script type="text/javascript">
$(document).ready(function() {
	$("#startTime").addClass("Wate").bind("click", function() {
		WdatePicker({
			skin : 'whyGreen',
			minDate : '1900-10-01',
			maxDate : '%y-%M-%d',
			dateFmt : 'yyyy-MM-dd'
		});
	});
	
	$("#townItems").multiSelect({ 
		minWidth:230,
		selectedList:5
	});
	
	$("#roadItems").multiSelect({ 
		minWidth:230,
		selectedList:5
	});
	
	$("#levelItems").multiSelect({ 
		minWidth:228,
		selectedList:5
	});
	
	$("#endTime").addClass("Wate").bind("click", function() {
		WdatePicker({
			skin : 'whyGreen',
			minDate : '#F{$dp.$D(\'startTime\')}',
			maxDate : '%y-%M-%d',
			dateFmt : 'yyyy-MM-dd'
		});
	});
	$("#submit").click(function(){
	var startTime = $("#startTime").val();
	var endTime = $("#endTime").val();
	var type = $("#type").val();

	var checkedBox1 = $("input[name=townItems]:checked");
	var  townItems = new String("")  ;
	$.each(checkedBox1, function(){
		townItems+=$(this).val()+", ";	 							
	});
	
	var checkedBox2 = $("input[name=roadItems]:checked");
	var  roadItems = new String("")  ;
	$.each(checkedBox2, function(){
		roadItems+=$(this).val()+", ";	 							
	});
	
	var checkedBox3 = $("input[name=levelItems]:checked");
	var  levelItems = new String("")  ;
	$.each(checkedBox3, function(){
		levelItems+=$(this).val()+", ";	 							
	});
	
	if( type != null && type != ""){
		$(window.parent.excelThree(startTime,endTime,type,townItems,roadItems,levelItems));
	}
	});
});
function clo() {
	$(window.parent.close()); 
}
</script>
</head>
<body>
<object id="factory" style="display:none;" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"></object> 
<script type="text/javascript"> 
function   window.onload()   { 
    //factory.printing.paperSize   =   "A3 " 
    factory.printing.header   =   " " 
    factory.printing.footer   =   " " 
    factory.printing.portrait   =   false 
    factory.printing.leftMargin   =   0.75 
    factory.printing.topMargin   =   1.5 
    factory.printing.rightMargin   =   0.75 
    factory.printing.bottomMargin   =   1.5 
    } 
</script> 

<div style="padding-top: 40px">
<table class="yform"><tr><td width="100%">
<form action="${ctx }/detect/detect!excelTownship.action" method="get" id="form" class="yform" name="form1">
<table class="forprint tdsd">
<tr>
   <td>提交时间：</td>
	<td width="250px">
	<input type="text" id="startTime" name="startTime" value="${param['startTime']}" style="width: 90px;" />
	至&nbsp;
	<input type="text" id="endTime" name="endTime" value="${param['endTime']}" style="width: 90px;" />
		</td>
		<td>镇区：</td>
		<td>
			<pt:code category="4419" name="townItems" default="${townItems}"  multiple="multiple"  ></pt:code>
		</td>
		<td>公路等级：</td>
		<td>
			<pt:code category="3006" name="roadItems" default="${roadItems}"  multiple="multiple" ></pt:code>
		</td>
		<td>计划类型：</td>
		<td><pt:code name="planType" category="3003" hasEmpty="true" default="${param['planType']}"  width="150"></pt:code></td>
	</tr>
<tr>	
	<td>行政级别：</td>
	 <td>
		  <pt:code category="3108" name="levelItems" default="${levelItems}"  multiple="multiple" ></pt:code>
	</td>
	<td>统计类型：</td>
	<td>
		<select name="type" id="type">
		<c:choose>
			<c:when test="${type == 'town'}"><option value="town" selected="selected">镇区</option></c:when>
		<c:otherwise><option value="town" >镇区</option></c:otherwise>
		</c:choose>
		<c:choose>
			<c:when test="${type == 'road'}"><option value="road" selected="selected">公路等级</option></c:when>
		<c:otherwise><option value="road" >公路等级</option></c:otherwise>
		</c:choose>
		<c:choose>
			<c:when test="${type == 'level'}"><option value="level" selected="selected">行政级别</option></c:when>
		<c:otherwise><option value="level" >行政级别</option></c:otherwise>
		</c:choose>
		</select>
	</td>
		
	<td align="left"><div class="type-button"><input type="submit" 
	class="search" value="统计" /></div>
	</td>
<td colspan="3">
<div class="type-button" style="text-align: right;">
<input  type="button" class="submit" id="submit" value="导出" />
<input type="button" class="button" onclick="factory.printing.PageSetup();" value="设置" />
<input type="button" class="button" onclick="factory.printing.Preview();" value="预览" />
<input type="button" class="button" onclick="factory.printing.Print(true); " value="打印" />
<input type="button" class="button" onclick="clo(); " value="关闭" />
</div>
</td></tr>
</table>
</form>
</td></tr>
<c:if test = "${ not empty spotReportVoList }">
<tr><td align="center">
<img alt="" src="${ctx }/servlet/displayChart?filename=${filename}" height="${jfreeChartBean.height}" width="${jfreeChartBean.width}">
</td></tr>
</c:if>
<tr><td>
<table class="detect">
<c:if test = "${ not empty spotReportVoList }">
<tr>
<td>统计时间</td><td colspan="2"><font color = "red">${startTime} - ${endTime}</font> </td>
<td>条件</td><td colspan="18" style="text-align: left" ><font color = "red">${condition } ${condition2 }</font> ${title }</td>
</tr>
</c:if>
<tr>
<td colspan="22" align="center">监督抽检</td></tr>
<tr>
<th rowspan="2"><c:if test="${type == 'town'}">镇区</c:if><c:if test="${type == 'road'}">公路等级</c:if><c:if test="${type == 'level'}">行政级别</c:if></th>
<th colspan="3" align="center">合计</th>  
<th colspan="3" align="center">路基工程</th>  <th colspan="3" align="center">路面工程</th>  	  <th colspan="3" align="center">桥梁工程</th>
<th colspan="3" align="center">隧道工程</th>  <th colspan="3" align="center">安全设施工程</th>   <th colspan="3" align="center">三大原材料</th>
</tr>

<tr>
<th>抽检数</th>   <th>合格数</th>   <th>合格率(%)</th>
<th>抽检数</th>   <th>合格数</th>   <th>合格率(%)</th>
<th>抽检数</th>   <th>合格数</th>   <th>合格率(%)</th>
<th>抽检数</th>   <th>合格数</th>   <th>合格率(%)</th>
<th>抽检数</th>   <th>合格数</th>   <th>合格率(%)</th>
<th>抽检数</th>   <th>合格数</th>   <th>合格率(%)</th>
<th>抽检数</th>   <th>合格数</th>   <th>合格率(%)</th>

</tr>

<c:forEach items="${spotReportVoList}" var="spotReportVoList">
<tr>
<td>${spotReportVoList.threeType}</td>
<td>${spotReportVoList.allTotalPassrateC }</td> <td>${spotReportVoList.allTotalPassrateP }</td> <td>${spotReportVoList.totalPassrate }</td>

<td>${spotReportVoList.structurespotC }</td> <td>${spotReportVoList.structurespotP }</td> <td>${spotReportVoList.structurespotT }</td>

<td>${spotReportVoList.surfacespotC }</td> <td>${spotReportVoList.surfacespotP }</td> <td>${spotReportVoList.surfacespotT}</td>

<td>${spotReportVoList.bridgespotC }</td> <td>${spotReportVoList.bridgespotP }</td> <td>${spotReportVoList.bridgespotT }</td>

<td>${spotReportVoList.tunnelspotC }</td> <td>${spotReportVoList.tunnelspotP }</td> <td>${spotReportVoList.tunnelspotT}</td>

<td>${spotReportVoList.safetyspotC }</td> <td>${spotReportVoList.safetyspotP }</td> <td>${spotReportVoList.safetyspotT }</td>

<td>${spotReportVoList.materialspotC}</td> <td>${spotReportVoList.materialspotP }</td> <td>${spotReportVoList.materialspotT }</td>
</tr>
</c:forEach>


<c:if test="${not empty listlocal}"><tr><td colspan="22"><font color="red">特殊数据（不会导出）</font></td></tr></c:if>
<c:forEach items="${listlocal}" var="spotReportVoList">
<tr>
<td>${spotReportVoList.threeType}</td>
<td>${spotReportVoList.allTotalPassrateC }</td> <td>${spotReportVoList.allTotalPassrateP }</td> <td>${spotReportVoList.totalPassrate }</td>

<td>${spotReportVoList.structurespotC }</td> <td>${spotReportVoList.structurespotP }</td> <td>${spotReportVoList.structurespotT }</td>

<td>${spotReportVoList.surfacespotC }</td> <td>${spotReportVoList.surfacespotP }</td> <td>${spotReportVoList.surfacespotT}</td>

<td>${spotReportVoList.bridgespotC }</td> <td>${spotReportVoList.bridgespotP }</td> <td>${spotReportVoList.bridgespotT }</td>

<td>${spotReportVoList.tunnelspotC }</td> <td>${spotReportVoList.tunnelspotP }</td> <td>${spotReportVoList.tunnelspotT}</td>

<td>${spotReportVoList.safetyspotC }</td> <td>${spotReportVoList.safetyspotP }</td> <td>${spotReportVoList.safetyspotT }</td>

<td>${spotReportVoList.materialspotC}</td> <td>${spotReportVoList.materialspotP }</td> <td>${spotReportVoList.materialspotT }</td>
</tr>
</c:forEach>


</table>
</td></tr>
</table>
</div>
</body>
